import { createRouter, createWebHashHistory } from 'vue-router'
import { basicRoutes } from '@/router/routes'
import { App } from 'vue'
import { setupRouterHooks } from '@/router/routerHooks'

export const router = createRouter({
  history: createWebHashHistory(),
  routes: basicRoutes
})

export function setupRouter (app: App<Element>): void {
  // 路由钩子函数
  setupRouterHooks()
  app.use(router)
}

export default router
